#include <iostream>
#include <cmath>
#include <string>
#include <unordered_map>

bool is_prime(int n) {
    if (n <= 1) return false;
    for (int i = 2; i <= std::sqrt(n); ++i) {
        if (n % i == 0) return false;
    }
    return true;
}

int words_to_number(const std::string& word) {
    static const std::unordered_map<std::string, int> num_dict {
        {"zero", 0}, {"one", 1}, {"two", 2}, {"three", 3}, {"four", 4},
        {"five", 5}, {"six", 6}, {"seven", 7}, {"eight", 8}, {"nine", 9}
    };
    auto it = num_dict.find(word);
    return it != num_dict.end() ? it->second : -1;
}

int closest_prime_number(const std::string& s) {
    auto num_dict = words_to_number(s);

    // Your logic here to find the closest prime number using the functions
    // Make sure you structure the closest prime finding logic as you did in Python
}

int main() {
    std::string input;
    std::getline(std::cin, input);
    int result = closest_prime_number(input);
    if (result != -1)
        std::cout << result;
    else
        std::cout << "wrong input";
    return 0;
}
